<template>
  <div>
    <p>set和assign</p>
    <div>
      {{a}}
    </div>
    <button @click="setAdd">setAdd</button>
    <button @click="assignAdd">assignAdd</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      a: {
        name: 'ygy'
      }
    }
  },
  methods: {
    setAdd () {
      this.$set(this.a, 'height', 171)
    },
    assignAdd () {
      this.a = Object.assign({}, this.a, {
        weight: 200
      })
    }
  }
}
</script>
